package com.demo;

public class Calculator {
	
	int i = 10;
	int j = 15;
			
	public int add(){
		int result = i+j;
		return result;
	}
	
	public void setNumbers(int first, int second){
		i=first;
		j=second;
	}
	
	public int changeAndAdd(int first, int second){
		first = first + 10;
		second = second + 10;
		
		System.out.println("first and second values in changeAndAdd  " + first + " " +second);
		return first + second;
		
		
	}


	public void changeAndAdd(Calculator calc2) {
		calc2.setNumbers(100,200);
		System.out.println("add result on calc2 after change" +calc2.add());
	}

}
